

# build_ius: clean_ius
# # build_ius:
# 	export PROJ_HOME=$(PROJ_HOME) && \
# 	ncverilog -64bit -elaborate -c -nclibdirname INCA_lib -f flist/top 
# 	# irun -64bit -elaborate -c -f flist/top 
# 	# irun -64bit -elaborate -c -sv -nclibdirname INCA_lib -f top.filelist -access +rwc -NOWARN PMBMDV -NOWARN FUNTSK -NOWARN SAWSTP -NOWARN AAMNSD -NOWARN VARIST 

# run_ius:
# 	# [ -e cl0_cpu0.tarmac ] && rm cl0_cpu*
# 	export PROJ_HOME=$(PROJ_HOME) && \
# 	ncverilog -64bit -R -nclibdirname INCA_lib -f flist/top  $(GUI) $(RUN_ARG)
# 	# irun -64bit -R -nclibdirname INCA_lib $(GUI) $(RUN_ARG) 

# source ~/cadence.bashrc && \

CFLAGS =-shared -fPIC -m64 -I$(C_INCLUDE_PATH)

run:libdpi_hello.so
	irun -64bit -nclibdirname INC_lib hello.sv +svroot+. +sv_lib=libdpi_hello

libdpi_hello.so: hello.c
	gcc $(CFLAGS) $^ -o $@

clean:
	rm -rf INCA_lib
	rm -rf irun.*
	rm -rf ncverilog.*
	rm -rf waves.shm